package cn.kgc.jdktest.demo10;

import java.util.stream.Stream;

/**
 * @Author:yaozhaobao
 * @Description:TODO
 * @version:1.0
 */
public class Test4 {

    public static void main(String[] args) {
        Stream<String> stream = Stream.of("马云", "赵丽颖", "马丽", "马赛克", "迪丽热巴",
                "马华腾", "发条魔灵", "马德里不思议", "马克思", "马冬梅", "柳岩");


       // stream.limit(4).forEach(System.out::println);

      // stream.skip(3).forEach(System.out::println);

      //  stream.skip(2).limit(3).forEach(System.out::println);
//        System.out.println(stream.count());

//        Stream<String> stream1 = Stream.of("张三");
//        Stream<String> stream2 = Stream.of("李四");
//
//        Stream<String> stream3 = Stream.concat(stream1, stream2);
//        stream3.forEach(System.out::println);

        Stream<String> streams = Stream.of("10", "20", "30");
        // 将流中的元素, 从String类型转换成Integer类型
        streams.map(t -> Integer.parseInt(t)).forEach(t -> System.out.println(t + 6));

    }
}
